Optimal. Leaf size=199 \[ \frac{a^3}{64 d (a \sin (c+d x)+a)^4}+\frac{a^2}{96 d (a-a \sin (c+d x))^3}-\frac{7 a^2}{48 d (a \sin (c+d x)+a)^3}-\frac{13 a}{128 d (a-a \sin (c+d x))^2}+\frac{41 a}{64 d (a \sin (c+d x)+a)^2}+\frac{69}{128 d (a-a \sin (c+d x))}-\frac{2}{d (a \sin (c+d x)+a)}+\frac{\sin (c+d x)}{a d}+\frac{187 \log (1-\sin (c+d x))}{256 a d}-\frac{443 \log (\sin (c+d x)+1)}{256 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.212357, antiderivative size = 199, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.103, Rules used = {2836, 12, 88} \[ \frac{a^3}{64 d (a \sin (c+d x)+a)^4}+\frac{a^2}{96 d (a-a \sin (c+d x))^3}-\frac{7 a^2}{48 d (a \sin (c+d x)+a)^3}-\frac{13 a}{128 d (a-a \sin (c+d x))^2}+\frac{41 a}{64 d (a \sin (c+d x)+a)^2}+\frac{69}{128 d (a-a \sin (c+d x))}-\frac{2}{d (a \sin (c+d x)+a)}+\frac{\sin (c+d x)}{a d}+\frac{187 \log (1-\sin (c+d x))}{256 a d}-\frac{443 \log (\sin (c+d x)+1)}{256 a d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2836
Rule 12
Rule 88
Rubi steps
\begin{align*} \int \frac{\sin ^2(c+d x) \tan ^7(c+d x)}{a+a \sin (c+d x)} \, dx &=\frac{a^7 \operatorname{Subst}\left (\int \frac{x^9}{a^9 (a-x)^4 (a+x)^5} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=\frac{\operatorname{Subst}\left (\int \frac{x^9}{(a-x)^4 (a+x)^5} \, dx,x,a \sin (c+d x)\right )}{a^2 d}\\ &=\frac{\operatorname{Subst}\left (\int \left (1+\frac{a^4}{32 (a-x)^4}-\frac{13 a^3}{64 (a-x)^3}+\frac{69 a^2}{128 (a-x)^2}-\frac{187 a}{256 (a-x)}-\frac{a^5}{16 (a+x)^5}+\frac{7 a^4}{16 (a+x)^4}-\frac{41 a^3}{32 (a+x)^3}+\frac{2 a^2}{(a+x)^2}-\frac{443 a}{256 (a+x)}\right ) \, dx,x,a \sin (c+d x)\right )}{a^2 d}\\ &=\frac{187 \log (1-\sin (c+d x))}{256 a d}-\frac{443 \log (1+\sin (c+d x))}{256 a d}+\frac{\sin (c+d x)}{a d}+\frac{a^2}{96 d (a-a \sin (c+d x))^3}-\frac{13 a}{128 d (a-a \sin (c+d x))^2}+\frac{69}{128 d (a-a \sin (c+d x))}+\frac{a^3}{64 d (a+a \sin (c+d x))^4}-\frac{7 a^2}{48 d (a+a \sin (c+d x))^3}+\frac{41 a}{64 d (a+a \sin (c+d x))^2}-\frac{2}{d (a+a \sin (c+d x))}\\ \end{align*}
Mathematica [A] time = 6.13077, size = 133, normalized size = 0.67 \[ \frac{768 \sin (c+d x)+\frac{414}{1-\sin (c+d x)}-\frac{1536}{\sin (c+d x)+1}-\frac{78}{(1-\sin (c+d x))^2}+\frac{492}{(\sin (c+d x)+1)^2}+\frac{8}{(1-\sin (c+d x))^3}-\frac{112}{(\sin (c+d x)+1)^3}+\frac{12}{(\sin (c+d x)+1)^4}+561 \log (1-\sin (c+d x))-1329 \log (\sin (c+d x)+1)}{768 a d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.105, size = 175, normalized size = 0.9 \begin{align*}{\frac{\sin \left ( dx+c \right ) }{da}}-{\frac{1}{96\,da \left ( \sin \left ( dx+c \right ) -1 \right ) ^{3}}}-{\frac{13}{128\,da \left ( \sin \left ( dx+c \right ) -1 \right ) ^{2}}}-{\frac{69}{128\,da \left ( \sin \left ( dx+c \right ) -1 \right ) }}+{\frac{187\,\ln \left ( \sin \left ( dx+c \right ) -1 \right ) }{256\,da}}+{\frac{1}{64\,da \left ( 1+\sin \left ( dx+c \right ) \right ) ^{4}}}-{\frac{7}{48\,da \left ( 1+\sin \left ( dx+c \right ) \right ) ^{3}}}+{\frac{41}{64\,da \left ( 1+\sin \left ( dx+c \right ) \right ) ^{2}}}-2\,{\frac{1}{da \left ( 1+\sin \left ( dx+c \right ) \right ) }}-{\frac{443\,\ln \left ( 1+\sin \left ( dx+c \right ) \right ) }{256\,da}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.05821, size = 251, normalized size = 1.26 \begin{align*} -\frac{\frac{2 \,{\left (975 \, \sin \left (d x + c\right )^{6} + 207 \, \sin \left (d x + c\right )^{5} - 2088 \, \sin \left (d x + c\right )^{4} - 360 \, \sin \left (d x + c\right )^{3} + 1569 \, \sin \left (d x + c\right )^{2} + 161 \, \sin \left (d x + c\right ) - 400\right )}}{a \sin \left (d x + c\right )^{7} + a \sin \left (d x + c\right )^{6} - 3 \, a \sin \left (d x + c\right )^{5} - 3 \, a \sin \left (d x + c\right )^{4} + 3 \, a \sin \left (d x + c\right )^{3} + 3 \, a \sin \left (d x + c\right )^{2} - a \sin \left (d x + c\right ) - a} + \frac{1329 \, \log \left (\sin \left (d x + c\right ) + 1\right )}{a} - \frac{561 \, \log \left (\sin \left (d x + c\right ) - 1\right )}{a} - \frac{768 \, \sin \left (d x + c\right )}{a}}{768 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.64101, size = 527, normalized size = 2.65 \begin{align*} -\frac{768 \, \cos \left (d x + c\right )^{8} + 1182 \, \cos \left (d x + c\right )^{6} - 1674 \, \cos \left (d x + c\right )^{4} + 636 \, \cos \left (d x + c\right )^{2} + 1329 \,{\left (\cos \left (d x + c\right )^{6} \sin \left (d x + c\right ) + \cos \left (d x + c\right )^{6}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 561 \,{\left (\cos \left (d x + c\right )^{6} \sin \left (d x + c\right ) + \cos \left (d x + c\right )^{6}\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \,{\left (384 \, \cos \left (d x + c\right )^{6} + 207 \, \cos \left (d x + c\right )^{4} - 54 \, \cos \left (d x + c\right )^{2} + 8\right )} \sin \left (d x + c\right ) - 112}{768 \,{\left (a d \cos \left (d x + c\right )^{6} \sin \left (d x + c\right ) + a d \cos \left (d x + c\right )^{6}\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.34441, size = 198, normalized size = 0.99 \begin{align*} -\frac{\frac{5316 \, \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right )}{a} - \frac{2244 \, \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right )}{a} - \frac{3072 \, \sin \left (d x + c\right )}{a} + \frac{2 \,{\left (2057 \, \sin \left (d x + c\right )^{3} - 5343 \, \sin \left (d x + c\right )^{2} + 4671 \, \sin \left (d x + c\right ) - 1369\right )}}{a{\left (\sin \left (d x + c\right ) - 1\right )}^{3}} - \frac{11075 \, \sin \left (d x + c\right )^{4} + 38156 \, \sin \left (d x + c\right )^{3} + 49986 \, \sin \left (d x + c\right )^{2} + 29356 \, \sin \left (d x + c\right ) + 6499}{a{\left (\sin \left (d x + c\right ) + 1\right )}^{4}}}{3072 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]